<template>
  <div class="flex-column">
    <div class="title">
      <div class="title-line" />
      <div class="title-content">
        <span class="arrow" />
        <span class="text">{{ props.title }}</span>
      </div>
    </div>
    <slot />
  </div>
</template>

<script lang="ts" setup>
import { onMounted } from 'vue'
const props = defineProps({
  // 标题
  title: {
    type: String,
    default: '',
    require: true
  }
})
onMounted(() => {
})
</script>
<style lang="scss" scoped>
.flex-column{
  display: flex;
  flex-direction: column;
  height: 100%;

  // 标题样式
  .title {
    display: flex;
    background-color: transparent;

    .title-line {
      width: 3px;
      background-color: rgb(28, 128, 246);
      margin-right: 3px;
    }

    .title-content {
      padding: 6px 10px;
      background-image: linear-gradient(to right, rgba(28, 128, 246, 0.5), rgba(28, 128, 246, 0));
      color: #fff;

      .arrow {
        position: relative;

        &::before {
          position: absolute;
          content: "";
          width: 0;
          height: 0;
          top: 3px;
          left: -4px;
          border-left: solid 5px #2CF2FE;
          border-top: solid 5px transparent;
          border-right: solid 5px transparent;
          border-bottom: solid 5px transparent;
        }
      }

      .text {
        font-size: 16px;
        font-weight: bold;
        margin-left: 20px;
      }
    }
  }
}
</style>
